#include "FPCH.h"

#include "FGlyphTransform.h"

namespace Font
{

	GlyphTransform::GlyphTransform(Library* a_Library)
	{
		m_Library = a_Library;
	}
	
	GlyphTransform::~GlyphTransform()
	{
		
	}

	void GlyphTransform::Transform(const tb::Vec2& a_Cursor, GlyphEntry* a_Glyph)
	{
		m_Corner[0].x = a_Glyph->pos_start.x; m_Corner[0].y = a_Glyph->pos_start.y;
		m_Corner[1].x = a_Glyph->pos_end.x;   m_Corner[1].y = a_Glyph->pos_start.y;
		m_Corner[2].x = a_Glyph->pos_start.x; m_Corner[2].y = a_Glyph->pos_end.y;
		m_Corner[3].x = a_Glyph->pos_end.x;   m_Corner[3].y = a_Glyph->pos_end.y;

		m_Corner[0] += a_Cursor;
		m_Corner[1] += a_Cursor;
		m_Corner[2] += a_Cursor;
		m_Corner[3] += a_Cursor;
	}

	const tb::Vec2& GlyphTransform::GetCornerUpperLeft()
	{
		return m_Corner[0];
	}

	const tb::Vec2& GlyphTransform::GetCornerUpperRight()
	{
		return m_Corner[1];
	}

	const tb::Vec2& GlyphTransform::GetCornerLowerLeft()
	{
		return m_Corner[2];
	}

	const tb::Vec2& GlyphTransform::GetCornerLowerRight()
	{
		return m_Corner[3];
	}

}; // namespace Font